home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / dinkum3 / pusher.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  19.5 KB  |  673 lines

  1. #define PUSHER
  2. #include "dink_sym.h"
  3. #include "dink_glb.h"
  4.  
  5. #if (PROTOTYPE)
  6. void pusher(int *n_arg)
  7. #else
  8. pusher(n_arg) 
  9. int *n_arg ;
  10. #endif
  11. /********************************************************************/
  12. /*                                                                  */
  13. /*                  --- The Pusher Subroutine ---                   */
  14. /*                                                                  */
  15. /*  Software by Gary A. Allen, Jr. 14 June 1989,    Version: Mk 1.2 */
  16. /*           (c) Copyright 1988 by Gary A. Allen, Jr.               */
  17. /*                                                                  */
  18. /********************************************************************/
  19. {
  20. register int i ;
  21. int n ;
  22. static long delta_time, *time_arg = 0 ;
  23. char file_name[80] ;
  24.  
  25. #if (PROTOTYPE)
  26. void which_button(void) ; 
  27. void lift_moves(void) ; 
  28. void nothing_happens(void) ; 
  29. void cubic(void) ; 
  30. void no_gray(void) ; 
  31. void no_switch(void) ; 
  32. void no_cube(void) ; 
  33. void describe(int) ;
  34. int yes_no(void) ;
  35. long time(long*) ;
  36. void ender(int) ;
  37. #else
  38. long time() ;
  39. int yes_no() ;
  40. #endif
  41.  
  42. /* pass the room pointer */
  43. n = *n_arg ;
  44.  
  45. /* reject an isolated "push" command */
  46. if (tag[V_VERB_ONLY]) {
  47.     printf ("What exactly do you want me to push? \n");
  48.     return; 
  49. }
  50.  
  51. /* Deal with the recorder */
  52. if (tag[V_red_button] || tag[V_white_button] || tag[V_green_button]
  53.         || tag[V_orange_button]) {
  54.     if (Gong->Status == S_recorder) {
  55.     if (Recorder->Location == B_have) {
  56.         if (tag[V_red_button]) {
  57.             if (Recorder->Status != S_inactive) {
  58.                 printf("--- The data recorder has stopped ") ;
  59.                 if (Recorder->Status == S_playing)
  60.                     printf("playing. ---\n") ;
  61.                 else printf("recording. ---\n") ;
  62.                 Recorder->Status = S_inactive ;
  63.                 fclose(fp) ;
  64.             }
  65.             else printf("Nothing happened!\n") ;
  66.             return ;
  67.         }
  68.         if (tag[V_white_button]) {
  69.             printf("Type in the file name for reading from:  ") ;
  70.             scanf("%s",file_name) ;
  71.             if ((fp = fopen(file_name,"r")) == 0) {
  72. printf("I could not open the file:  %s \n",file_name);
  73. printf("This file probably doesn't exit.\n") ;
  74. printf("Try pressing the white button again and using a different name.\n") ;
  75.             }
  76.             else Recorder->Status = S_playing ;
  77.             return ;
  78.         }
  79.         if (tag[V_green_button]) {
  80.             printf("Type in the file name for writing to:  ") ;
  81.             scanf("%s",file_name) ;
  82.             if ((fp = fopen(file_name,"w")) == 0) {
  83. printf ("I could not open the file:  %s \n",file_name);
  84. printf("Try pressing the green button again and using a different name.\n") ;
  85.             }
  86.             else {
  87.                 Recorder->Status = S_recording ;
  88.                 printf("--- Recording ---\n") ;
  89.             }
  90.             return ;
  91.         }
  92. if (tag[V_orange_button]) {
  93.     printf("Dinkum's clock has been stopped.\n\n") ;
  94.     delta_time = time(time_arg) - (start_time + 3300L) ;
  95.  
  96.     for (;;) {
  97.         printf("Do you wish to resume playing Dinkum?\n") ;
  98.         if (yes_no()) {
  99.             start_time = time(time_arg) - (delta_time + 3300L) ;
  100. printf("\n+----------------------------------------------------------+\n") ;
  101. printf("| Dinkum's clock is restarted with the same time remaining |\n") ;
  102. printf("| as when it was halted.                                   |\n") ;
  103. printf("+----------------------------------------------------------+\n\n");
  104.             describe(n) ;
  105.             return ;
  106.         }
  107.         else {
  108.             printf("Do you wish to quit Dinkum?\n") ;
  109.             if (yes_no()) ender(F_quit) ;
  110.         }
  111.     }
  112. }
  113.     }
  114.     else printf("You don't have the recorder in your possession!\n") ;
  115.     }
  116.     else printf("I have never seen a button of that color.\n") ;
  117.     return ;
  118. }
  119.  
  120. switch (n) {
  121. /* Lift entrance at the ground level */
  122. case R_lift_entr:
  123.     if (tag[V_gray_button]) {
  124.         no_gray() ;
  125.         return ;
  126.     }
  127.     if (!tag[V_button]) {
  128.         if (!tag[V_blue_button]) {
  129.             printf ("I don't see why I should push that! \n");
  130.         }
  131.         else nothing_happens() ;
  132.         return ;
  133.     }
  134.     if (Lift_door->Status == S_flashing ) {
  135. printf ("You push the call button and there is a loud \"whirr\" from ");
  136. printf ("an electric motor. \nThe massive steel doors slide open ");
  137. printf ("revealing a huge lift that could hold \ntwenty men at once. ");
  138. printf ("The way is now open for you to enter. \n");
  139.         Lift_door->Status = S_open ;
  140.         room[R_lift_entr][2] = R_lift_inside ;
  141.         break ;
  142.     }
  143.     else {
  144.         if (Lift_door->Status == S_open) {
  145. printf ("You push the call button and there is a loud \"whirr\" from ");
  146. printf ("an electric motor. \nThe massive steel doors slide shut, ");
  147. printf ("closing off access to the lift.\n");
  148.             Lift_door->Status = S_flashing ;
  149.             room[R_lift_entr][2] = R_WALL ;
  150.             break ;
  151.         }
  152.         else {
  153. printf("You pushed the lift call button, but nothing happened.\n");
  154. printf("I think the electrical power has been turned off at the\n") ;
  155. printf("circuit breaker.\n") ;
  156.         break ;
  157.         }
  158.     }
  159.  
  160. /* Lift Compartment */
  161. case R_lift_inside:
  162.     if (tag[V_gray_button]) {
  163.         no_gray() ;
  164.         return ;
  165.     }
  166.  
  167.     /* scan push sentence */
  168.     /* zero level */
  169.     if (tag[V_0]) {
  170.         if (Lift->Status == L0) {
  171. printf ("You pushed the flashing button, but nothing happened.\n");
  172.             break ;
  173.         }
  174. printf ("The steel doors slam shut and you feel heavy as the lift ");
  175. printf ("accelerates \nupwards.  Finally the lift jerks to a halt ");
  176. printf ("and the doors whirr open.  \nSunlight is streaming in. ");
  177. printf ("Once again you are breathing the fresh air.\n");
  178.         Lift->Status = L0 ;
  179.         room[R_lift_inside][3] = R_lift_entr;
  180.         room[R_lift_inside][7] = R_lift_entr;
  181.         return ;
  182.     }
  183.  
  184.     /* forty-ninth level */
  185.     if (tag[V_49]) {
  186.         if (Lift->Status == L49) {
  187. printf ("You pushed the forty-nine button, but nothing happened.\n");
  188.             return ;
  189.         }    
  190.         Lift->Status = L49 ;
  191.         room[R_lift_inside][3] = R_L49_entr;
  192.         room[R_lift_inside][7] = R_L49_entr;
  193.         lift_moves() ;
  194.         return ;
  195.     }
  196.  
  197.     /* sixty-seventh level */
  198.     if (tag[V_67]) {
  199.         if (Lift->Status == L67) {
  200. printf ("You pushed the sixty-seven button, but nothing happened.\n");
  201.             return ;
  202.         }    
  203.         Lift->Status = L67;
  204.         room[R_lift_inside][3] = R_L67_entr;
  205.         room[R_lift_inside][7] = R_L67_entr;
  206.         lift_moves() ;
  207.         return ;
  208.     }
  209.  
  210.     /* eighty-second level */
  211.     if (tag[V_82]) {
  212.         if (Lift->Status == L82) {
  213. printf ("You pushed the eighty-two button, but nothing happened.\n");
  214.             return ;
  215.         }    
  216.         Lift->Status  = L82;
  217.         room[R_lift_inside][3] = R_L82_entr;
  218.         room[R_lift_inside][7] = R_L82_entr;
  219. printf ("The steel doors slam shut and you feel a sense of ");
  220. printf ("weightlessness as \nthe lift plummets down the mine shaft. ");
  221. printf ("Finally the lift comes to a halt \n");
  222. printf ("and the doors whirr open. \n");
  223.         return ;
  224.     }
  225.     if (tag[V_blue_button]) {
  226.         nothing_happens() ;
  227.         return ;
  228.     }
  229. printf ("This lift can go only to levels 0, 49, 67, or 82 \n");
  230.     return ;
  231.  
  232. /* inside the closet at the Iranian Parliament */
  233. case R_closet:
  234.     if (tag[V_gray_button]) {
  235.         no_gray() ;
  236.         return ;
  237.     }
  238.     if (tag[V_blue_button] || tag[V_button]) {
  239.         /* Is the command for the black cube */
  240.         if (Cube->Location != B_have) {
  241.             no_switch() ;
  242.         }
  243. printf("There is a bright flash of light! Then suddenly you are\n");
  244. printf("back in the hexagon chamber of the ancient spaceship.\n\n");
  245.         *n_arg = R_transporter ;
  246.     }
  247.     else no_switch() ;
  248.     return ;
  249.  
  250.  
  251. /* the transporter control panel room */
  252. case R_panel:
  253.     if (tag[V_button]) {
  254.         which_button() ;
  255.         return;
  256.     }
  257.     if (tag[V_blue_button]) {
  258.         if (Cube->Location==B_have) cubic() ;
  259.         else no_cube() ;
  260.         return ;
  261.     }
  262.     if (tag[V_gray_button]) {
  263.         if (!Transporter->Status) {
  264. printf("Lots of the \"Sanskrit\" text is flashing by on the display\n");
  265. printf("panel's CRTs.  There is a whirring noise coming out of the\n");
  266. printf("equipment around you which is increasing in both loudness\n");
  267. printf("and pitch. You've turned something on, that's for sure!\n") ;
  268.             Transporter->Status = TRUE ;
  269.         }
  270.         else nothing_happens() ;
  271.         return ;
  272.     }
  273. default:
  274.     /* Semtex explosive detector */
  275.     if (tag[V_detector] || tag[V_yellow_button] ||
  276.         ((Cube->Location != B_have) &&
  277.         (Detector->Location == B_have))) { 
  278.             if (Detector->Location == B_have) {
  279.                 /* press Semtex detector button */
  280. printf("You press the button on the Semtex explosive detector and\n");
  281.                 for (i = 0; i <= 9; i++) {
  282.                     if ((n == i+207)||(n == i+228)) {
  283. if (room[227-i][M_rm_type] == T_lethal) {
  284.     printf("hear a \"beep, beep, beep\".\n") ;
  285.     return ;
  286. }
  287.                     }
  288.                 }
  289.                 printf("the yellow light flashed.\n") ;
  290.             }
  291.             else {
  292. printf("You don't have the detector in your possession.\n") ;
  293.             }
  294.             return ;
  295.         }
  296.         /* Transporter return device */
  297.         if (Cube->Location == B_have) {
  298.             if ((Detector->Location == B_have) && 
  299.                 (!tag[V_blue_button])) {
  300.                     which_button() ;
  301.                     return;
  302.             }
  303.             cubic() ;
  304.             return ;
  305.         }
  306.         if (tag[V_blue_button]) {
  307.             no_cube() ;
  308.             return ;
  309.         }
  310.         if (tag[V_gray_button]) {
  311.             no_gray() ;
  312.             return ;
  313.         }
  314.  
  315. printf ("You can push as much as you like, but nothing will happen.\n");
  316. } /* end of the switch block */
  317. return; 
  318.  
  319. } /* --- end of the "pusher" subroutine --- */
  320.  
  321. #if (PROTOTYPE)
  322. void which_button(void) 
  323. #else
  324. which_button() 
  325. #endif
  326. /********************************************************************/
  327. /*                                                                  */
  328. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  329. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  330. /*                                                                  */
  331. /********************************************************************/
  332. {
  333. printf("Which button do you want me to push? \n") ;
  334. return; 
  335. } /* --- end of the "which_button" subroutine --- */
  336.  
  337. #if (PROTOTYPE)
  338. void lift_moves(void) 
  339. #else
  340. lift_moves() 
  341. #endif
  342. /********************************************************************/
  343. /*                                                                  */
  344. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  345. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  346. /*                                                                  */
  347. /********************************************************************/
  348. {
  349. printf ("The steel doors slam shut and you feel the vibration of ");
  350. printf ("the lift \nmoving in its shaft. Finally the lift jerks ");
  351. printf ("to a halt and the doors whirr open. \n");
  352. return; 
  353. } /* --- end of the "lift_moves" subroutine --- */
  354.  
  355. #if (PROTOTYPE)
  356. void nothing_happens(void) 
  357. #else
  358. nothing_happens() 
  359. #endif
  360. /********************************************************************/
  361. /*                                                                  */
  362. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  363. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  364. /*                                                                  */
  365. /********************************************************************/
  366. {
  367. printf("Nothing happens!\n");
  368. return; 
  369. } /* --- end of the "nothing_happens" subroutine --- */
  370.  
  371. #if (PROTOTYPE)
  372. void cubic(void) 
  373. #else
  374. cubic() 
  375. #endif
  376. /********************************************************************/
  377. /*                                                                  */
  378. /*              Press cube button in wrong place.                   */
  379. /*                                                                  */
  380. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  381. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  382. /*                                                                  */
  383. /********************************************************************/
  384. {
  385. printf("You press the button on the cube but nothing happens.\n");
  386. return; 
  387. } /* --- end of the "cubic" subroutine --- */
  388.  
  389. #if (PROTOTYPE)
  390. void no_gray(void) 
  391. #else
  392. no_gray() 
  393. #endif
  394. /********************************************************************/
  395. /*                                                                  */
  396. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  397. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  398. /*                                                                  */
  399. /********************************************************************/
  400. {
  401. printf("I see no gray button to push!\n");
  402. return; 
  403. } /* --- end of the "no_gray" subroutine --- */
  404.  
  405. #if (PROTOTYPE)
  406. void no_switch(void) 
  407. #else
  408. no_switch() 
  409. #endif
  410. /********************************************************************/
  411. /*                                                                  */
  412. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  413. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  414. /*                                                                  */
  415. /********************************************************************/
  416. {
  417. printf("There is nothing here with a push button switch.\n");
  418. return; 
  419. } /* --- end of the "no_switch" subroutine --- */
  420.  
  421. #if (PROTOTYPE)
  422. void no_cube(void) 
  423. #else
  424. no_cube() 
  425. #endif
  426. /********************************************************************/
  427. /*                                                                  */
  428. /*  Software by Gary A. Allen, Jr. 8 December 1992  Version: Mk 1.0 */
  429. /*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  430. /*                                                                  */
  431. /********************************************************************/
  432. {
  433. printf("You don't have the black cube with the blue button in your") ;
  434. printf(" possession!\n") ;
  435. return; 
  436. } /* --- end of the "no_cube" subroutine --- */
  437.  
  438.  
  439. #if (PROTOTYPE)
  440. void switcher(int n)
  441. #else
  442. switcher(n) 
  443. int n ;
  444. #endif
  445. /********************************************************************/
  446. /*                                                                  */
  447. /*                --- The Switcher Subroutine ---                   */
  448. /*                                                                  */
  449. /*                                                                  */
  450. /*  Software by Gary A. Allen, Jr. 29 October 1989  Version: Mk 1.4 */
  451. /*           (c) Copyright 1988 by Gary A. Allen, Jr.               */
  452. /*                                                                  */
  453. /********************************************************************/
  454. {
  455. int flag_switch, flag_rifle_md ;
  456.  
  457. #if (PROTOTYPE)
  458. void dialer(int) ;
  459. #endif
  460.  
  461. /* deal with single verb commands */
  462. if (tag[V_VERB_ONLY]) {
  463.     if (tag[V_turn]) printf("Turn what?\n") ;
  464.     if (tag[V_set]) printf("Set what?\n") ;
  465.     if (tag[V_select]) printf("Select what?\n") ;
  466.     if (tag[V_switch]) printf("Switch what?\n") ;
  467.     return ;
  468. }
  469.  
  470. /* Deal with changing the safety on the rifle */
  471. if (tag[V_safety]) {
  472.     if (Rifle->Location == B_have) {
  473.         if (tag[V_off]) {
  474.             rifle_flag = F_single ;
  475. printf("The M16 rifle is set to single shot mode ") ;
  476. printf("with the safey off.\n") ;
  477.             return ;
  478.         }
  479.         if (tag[V_on]) {
  480.             rifle_flag = F_safety ;
  481. printf("The M16 rifle's safety has been turned on.\n") ;
  482.             return ;
  483.         }
  484.         printf("How do you want the safety set?\n") ;
  485.     }
  486.     else printf("You're not holding the rifle!\n") ;
  487.     return ;
  488. }
  489.  
  490. /* deal with special case "turn (safe) dial 0 49 67 82" */
  491. if (tag[V_turn] && tag[V_dial] && (!tag[V_rifle])) {
  492.     dialer(n) ;
  493.     return ;
  494. }
  495.  
  496. /* deal with special case "turn safe ..." */
  497. if (tag[V_turn] && (!tag[V_dial]) && tag[V_safe]) {
  498.     if (n != R_office_mang) {
  499.         printf("There is no safe here to turn!\n") ;
  500.         return  ;
  501.     }
  502. printf("Since the safe is set in a concrete wall, turning it would\n");
  503. printf("be rather difficult!  Perhaps I should turn the safe's\n") ;
  504. printf("dial instead?\n") ;
  505.     return ;
  506. }
  507.  
  508. /* initialize the local switches */
  509. flag_switch = F_no_argument ; 
  510. if (tag[V_on]) flag_switch = TRUE ;
  511. if (tag[V_off]) flag_switch = FALSE ;
  512. if (verb == V_light) flag_switch = TRUE ;
  513.  
  514. flag_rifle_md = F_no_argument ;
  515. if (tag[V_safe]) flag_rifle_md = F_safety ;
  516. if (tag[V_triple]) flag_rifle_md = F_triple ;
  517. if (tag[V_single]) flag_rifle_md = F_single ;
  518. if (tag[V_auto]) flag_rifle_md = F_auto ;
  519.  
  520. if ((flag_switch == F_no_argument)&&(flag_rifle_md == F_no_argument)) {
  521. printf("You will have to be a little more specific than that. \n") ;
  522.     return ;
  523. }
  524.  
  525. /* see if it is a simple "on/off" power equipment switch command */
  526. if ((!tag[V_torch])&&(!tag[V_rifle])&&
  527.     (flag_rifle_md == F_no_argument)) {
  528. if (n == R_store_room) {
  529.     /* The circuit breaker is switched off */
  530.     if (flag_switch == FALSE) {
  531.     if (Circuit_breaker->Status) {
  532. printf ("As you pull the switch lever, there is a bright blue \n");
  533. printf ("arc and then all of the lights go out. \n");
  534.         Circuit_breaker->Status = FALSE ;
  535.         Lift_door->Status = S_closed ;
  536.         room[R_lift_entr][2] = R_WALL ;
  537.     }
  538.     else printf ("The circuit breaker is already turned off! \n");
  539.     return;
  540.     }
  541.     /* The circuit breaker is switched on */
  542.     if (flag_switch == TRUE) {
  543.     if (Circuit_breaker->Status) {
  544.     printf ("The circuit breaker is already turned on! \n");
  545.     }
  546.     else {
  547. printf ("As you pull the switch lever, there is a loud \"CLUNK\" \n");
  548. printf ("and you see a POWER ON light glowing. \n");
  549.         Circuit_breaker->Status = TRUE ;
  550.         Lift_door->Status = S_flashing ;
  551.     }
  552.     return;
  553.     }
  554. }          
  555.  
  556. /* Deal with a garbage command */
  557. printf("I don't understand what you want me to switch. \n") ;
  558. return ;
  559. } /* end of the simple "on/off" switch group */
  560.  
  561. /* the switch command is to select an M16 rifle firing mode */
  562. if (tag[V_rifle]) {
  563.     if (Rifle->Location == B_have) {
  564.  
  565.         /* turn the rifle on naively */
  566.         if ((flag_switch==TRUE)||
  567.                ((flag_rifle_md==F_safety)&&(flag_switch==FALSE))) {
  568.             if (rifle_flag != F_safety) {
  569. printf("The rifle's safety is already off! \n") ; 
  570.                 return;
  571.             }
  572.             rifle_flag = F_single ;
  573. printf("The M16 rifle has been set to single shot mode. \n") ;
  574.             return ;
  575.         } 
  576. /* turn on the safety */
  577.     if ((flag_switch==FALSE)||
  578.       ((flag_rifle_md==F_safety)&&((flag_switch==TRUE)||
  579.       (flag_switch==F_no_argument)))) {
  580.                 if (rifle_flag == F_safety) {
  581. printf("The rifle's safety is already on! \n") ; 
  582.                 return;
  583.                 }
  584.             rifle_flag = F_safety ;
  585. printf("The M16 rifle's safety has now been turned on. \n") ;
  586.             return ;
  587.     } 
  588.         /* select single shot mode */  
  589.         if (flag_rifle_md == F_single) {
  590.             if (rifle_flag == F_single) {
  591. printf("The rifle has already been set to single shot mode.\n");
  592.                 return;
  593.             }
  594.             rifle_flag = F_single ;
  595. printf("The M16 rifle has been set to single shot mode. \n") ;
  596.             return ;
  597.         } 
  598.         /* select triple fire mode */  
  599.         if (flag_rifle_md == F_triple) {
  600.             if (rifle_flag == F_triple) {
  601. printf("The rifle has already been set to triple fire mode.\n");
  602.                 return;
  603.             }
  604.             rifle_flag = F_triple ;
  605. printf("The M16 rifle has been set to triple fire mode. \n") ;
  606.             return ;
  607.         } 
  608.         /* select to fully automatice mode */
  609.         if (flag_rifle_md == F_auto) {
  610.             if (rifle_flag == F_auto) {
  611. printf("The rifle has already been set to fully automatic.\n");
  612.                 return;
  613.             }
  614.             rifle_flag = F_auto ;
  615. printf("The M16 rifle has been set to fully automatic. \n") ;
  616.             return ;
  617.         } 
  618.     }
  619.     /* This is the rifle nonpossession error handler */
  620.     else {
  621. printf("You don't have a rifle in your possession! \n") ;
  622.         return ;
  623.     }
  624. } /* end of the rifle mode switching block */
  625.  
  626. /* the switch command is to turn the torch off or on. */
  627. if (tag[V_torch]) {
  628.     if (Torch->Location == B_have) {
  629.         /* "switch torch on" command */
  630.         if (flag_switch==TRUE) {
  631.             if (Torch->Status) {
  632. printf("The torch is already turned on.\n") ;
  633.                 return ;
  634.             }
  635. printf("An intense beam of light is projected from the torch.\n") ;
  636.             Torch->Status = TRUE ;
  637.             return ;
  638.         }
  639.         /* "switch torch off" command */
  640.         if (flag_switch==FALSE) {
  641.             if (!Torch->Status) {
  642. printf("The torch isn't switched on.\n") ;
  643.                 return ;
  644.             }
  645. printf("The torch switches off with a \"click\".\n") ;
  646.             Torch->Status = FALSE ;
  647.             return ;
  648.         }
  649.     }
  650. printf("You don't have a torch in your possession to switch! \n") ;
  651.     return ;
  652. }
  653.  
  654. } /* --- end of the "switcher" subroutine --- */
  655.  
  656. #if (PROTOTYPE)
  657. void new_score(void) 
  658. #else
  659. new_score() 
  660. #endif
  661. /* This subroutine calculates the score based on treasure in the safe */
  662. {
  663. register int i ;
  664. OBJECT_STRUCT *pnt ;
  665.  
  666. score = 0 ;
  667. pnt = object ;
  668. for (i = 0; i < Objcnt; i++) if ((pnt++)->Location == B_in_safe)  {
  669.         score += (pnt - 1)->Value ;
  670. } ;
  671. } /* --- end of the "new_score" subroutine --- */
  672.  
  673.